package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    //删除
    int deleteByPrimaryKey(Long id);

    //插入
    int insert(Employee record);

    //根据id查询
    Employee selectByPrimaryKey(Long id);

    //查询所有
    List<Employee> selectAll();

    //更新
    int updateByPrimaryKey(Employee record);

    //查询总数
    int selectForCount(QueryObject qo);

    //分页
    List<Employee> selectForList(QueryObject qo);

    void insertRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    void roleRelation2(@Param("employeeId") Long employeeId, @Param("ids") Long[] ids);

    void deleteRelation(Long id);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    Employee selectByPassword(@Param("id") Long id, @Param("oldPassword") String oldPassword);

    void updateByPassword(@Param("id") Long id, @Param("newPassword") String newPassword);


    void batchDelete(@Param("ids") Long[] ids);

    Employee selectByName(String name);

    List<Employee> selectRolenSn(String[] sns);
}